/**
 * Copyright(c) 2006-2008, FeyaSoft Inc.
 */
package("feyaSoft.desktop");

/**
 * This JS is util class for desktop.js file
 *
 * @author fzhuang
 * @Date July 26, 2007
 */
feyaSoft.desktop.Util = function(){
    // private parameters
    var activeWindow;
    
    return {
	    /**
	     * mimimize window
	     * @method minimizeWin
	     * @param {any} win - window to be mimimize
	     * @return 
	     */ 
	    minimizeWin : function(win){
	        win.minimized = true;
	        win.hide();
	    },

	    /**
	     * mark window active
	     * @method markActive
	     * @param {any} win - window active
	     * @return 
	     */ 	
	    markActive : function(win){
	        if(activeWindow && activeWindow != win){
	            feyaSoft.desktop.Util.markInactive(activeWindow);
	        }
	        activeWindow = win;
	        Ext.fly(win.taskItem.el).addClass('active-win');
	        win.minimized = false;
	    },

	    /**
	     * mark window in-active
	     * @method markInActive
	     * @param {any} win - window in active
	     * @return 
	     */ 	
	    markInactive : function(win){
	        if(win == activeWindow){
	            activeWindow = null;
	            Ext.fly(win.taskItem.el).removeClass('active-win');
	        }
	    }
    }

}();